<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>玉灵 QQ:7031633 Email:webrx@126.com</title>
    <script src="static/jquery/jquery-3.6.0.js"></script>
    <script src="static/layer/layer.js"></script>
</head>

<body>

<img src="/cc" id="cc" alt="">
<a href="">产品中心</a>&nbsp;<a href="javascript:void(0)" id="shop">购物车</a>


<hr>
<script>
    $(function () {
        //layer.alert('hello')

        $('#cc').click(function(){
            $(this).attr('src','/cc?' + new Date()).attr('title','点击换一张')
        })

        $('#shop').click(function () {
            fetch('/islogin').then(res => res.text()).then(res => {
                if (res === 'true') {
                    layer.load('loading',function(){
                        location.href = 'c.jsp'
                    })
                } else {
                    layer.open({title:'系统提示',icon:1,content:'没有登录，请登录','yes':function(){
                            location.href='login.html'
                        }
                    })
                }
            }).catch(e => console.log(e))
        })
    })
</script>
</body>
</html>
